package com.liucheng;

public class liucheng3 {
	//���1-10����
	public void printInt1(){
		int i=1;
		for(i=1;i<11;i++){
			System.out.println(i);
			//输出从1-10的数
		}
	}
	//���10-1����
	public void printInt2(){
		int i=10;
		while(i>=1){
			System.out.println(i);
			i--;
			//输出从1-10的数
		}
	}
	//����1-10�ĺ�
	public void sum(){
		int sum=0;
		int i=10;
		while(i>=1){
			sum+=i;
			i--;
		}
		System.out.println(sum);
	}
	//����1-100֮��ż���ĺ�
	public void sum1(){
		int i=100;
		int sum=0;
		for(i=100;i>=1;i--){
			if(i%2==0){
				sum+=i;
			}
		}
		System.out.println(sum);
	}
	//����1-100֮��ż���ĺ�
	public void sum2(){
		int i=100;
		int sum=0;
		for(i=100;i>=1;i--){
			if(i%2==1){
				sum+=i;
			}
		}
		System.out.println(sum);
	}
	//��5�Ľ׳�
	public void multipy(){
		int i=5;
		int mul=1;
		for(;i>=1;i--){
			mul*=i;
		}
		System.out.println(mul);
	}
	//ˮ�ɻ��� ��1.һ���Ǹ���λλ��2.ÿλ�������η�֮�͵��������
		public void shui(){
			int e=0;
			for(int a=100;a<1000;a++){
				
				int b=a/100;
				int c=(a-b*100)/10;
				int d=a-b*100-c*10;
				if((b*b*b+c*c*c+d*d*d)==a){
					System.out.println(a);
					e++;
				}
			}
			System.out.println("ˮ�ɻ�����"+e+"��");
		}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new liucheng3().printInt1();//���1-10����
		System.out.println(">>>>>>>>>>");
		new liucheng3().printInt2();//���10-1����
		System.out.println(">>>>>>>>>>");
		new liucheng3().sum();//����1-10�ĺ�
		System.out.println(">>>>>>>>>>");
		new liucheng3().sum1();//����1-100��ż���ĺ�
		System.out.println(">>>>>>>>>>");
		new liucheng3().sum2();//����1-100�������ĺ�
		System.out.println(">>>>>>>>>>");
		new liucheng3().multipy();//��5�Ľ׳�
		System.out.println(">>>>>>>>>>");
		new liucheng3().shui();//��ˮ�ɻ�����ͳ�Ƹ���
//		System.out.println(100%3);
	}

}
